<?php
/**
 * CFG.class.php
 *
 * included by switchboard to handle preferences
 * 
 * @author David Christian Liedle <david.liedle@gmail.com>
 * @link   http://nmox.org/
 *
 */

################################################################################
# Class CFG
#
class CFG {

	var $CFG; // use this as an array
	var $is_configured = FALSE; // changes to TRUE once there's something useable
	
	function CFG($config_is_here){

		global $NMOX_ROOT_PATH;
		$config_is_here = $NMOX_ROOT_PATH . $config_is_here;
		$this->readCFG($config_is_here);
	
	}
	
	function readCFG($config_location){
	    
        global $NMOX_ROOT_PATH;
        global $NMOX_CFG;
        
		if( strpos($config_location, ".php") ){
            $this->CFG = $NMOX_CFG;
            // don't have to read a file if its php
        } else {
            die( "Not yet set up to read alternate config formats..." );
        }
	
	}
	
	function writeCFG(){
	
		// lay down values to proper destination
		// VERRRRY IMPORTANT!
		// this needs to use the correct write method, via fwrite or whatever
	
	}
	
	function getCFG(){
	
		// returns config values
		return $this->CFG;
	
	}
	
	function setCFG($key, $value){
	
		// sets config value
		// note: this is temporary unless $this->writeCFG() is called!
		$this->CFG[$key] = $value;
	
	}

}

locateMe("/nmox/modules/CFG.class.php");
